export const formatMoney = (value: number | string) => {
	return typeof value === 'string'
		? parseFloat((value as string).trim().replace(/,/g, ''))
		: typeof value === 'number'
			? value
			: 0;
};

export const formatDisplayMoney = (value: number | string) => {
	return String(formatMoney(value)).replace(/\B(?=(\d{3})+(?!\d))/g, ',');
};

export const transformDisplayToNumber = (value: number | string) => {
	console.log('transform: ', value);
	return parseFloat(String(value).replace(/,/g, ''));
};
